<?php

function convertSize($size)
{
	$unit=array('b','kb','mb','gb','tb','pb');
	return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
}

$timesTest = 100;

for ($x=0; $x<=$timesTest; $x++)
{
	print 'Running <strong>ADD</strong> example<br />';
	$start = microtime(1);
	addTest($x);
	print 'Done in '.round(microtime(1) - $start, 10).'<br /><br />';

	print 'Running <strong>Delete</strong> example<br />';
	$start = microtime(1);
	deleteTest($x);
	print 'Done in '.round(microtime(1) - $start, 10).'<br />';
	print "<hr />";
}

print "<br /><br />Time: ".round(microtime(1) - $glboalStart, 6).'s.';
print "<br />Memo: ".convertSize(memory_get_peak_usage());
print "<br />Read: ".$readTimes . ' times, '.round(array_sum($timings['read']) / $timesTest, 4);
print "<br />Written: ".$writtenTimes . ' times, '.round(array_sum($timings['write']) / $timesTest, 4);
print "<br />Deleted: ".$deletedTimes . ' times, '.round(array_sum($timings['delete']) / $timesTest, 4);
print "<br />Replaced: ".$replacedTimes . ' times, '.round(array_sum($timings['replace']) / $timesTest, 4);